///<reference path='.\compiler\typescript.ts' />
///<reference path='typescript-node-definitions/node.d.ts'/>

var fileSystem = require("fs");
class TsCodeAnalyzer{

	static parser : TypeScript.Parser = new TypeScript.Parser();
	
	static analyze(code: TypeScript.StringSourceText):void{
		console.log("Parsing : [" + code.getLength() + "]");
		
		var ret = TsCodeAnalyzer.parser.parse(code, "d.js", 0);
		console.log(ret);
	}

}
/*var code: string = "class myClass{ a(arg1:string, arg2:number):string{ return 2;} }";
var codeSource = new TypeScript.StringSourceText(code);
TsCodeAnalyzer.analyze(codeSource);*/

fileSystem.readFile('ts.ts', 'utf8', function (err, data) {
    if (err) {
        return console.log(err);
    }
    try {
        TsCodeAnalyzer.analyze(new TypeScript.StringSourceText(data));
    } catch (e) {
        console.log(e);
    }
    
});

